package exception;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Practice {
    public static void main(String[] args) throws IOException {
        /*FileOutputStream sis=new FileOutputStream("dd.txt");
        OutputStreamWriter sos=new OutputStreamWriter(sis);
        BufferedWriter ses=new BufferedWriter(sos);
        PrintWriter sd=new PrintWriter(ses);
        sd.println("日落西山无处去，天涯何处饭斜阳");
        sd.println("今日花开知叶落，明年有缝烟罗春");
        sd.close();*/
        /*FileOutputStream sis=new FileOutputStream("dd.txt");
        OutputStreamWriter sos=new OutputStreamWriter(sis);
        BufferedWriter ses=new BufferedWriter(sos);
        PrintWriter sws=new PrintWriter(ses);
        System.out.println("please,开始输入：");
        Scanner scan=new Scanner(System.in);
        while(true){
            String line=scan.nextLine();
            if("exit".equals(line)){
               break;
            }
            sws.println(line);

        }

        sws.flush();
        sws.close();
        System.out.println("搞定");*/
       /* FileInputStream sis=new FileInputStream("dd.txt");
        InputStreamReader  sos=new InputStreamReader(sis, StandardCharsets.UTF_8);
        BufferedReader ses=new BufferedReader(sos);
        String line;
        while((line=ses.readLine())!=null) {
            System.out.println(line);
        }
        ses.close();*/



            FileInputStream sis=new FileInputStream("da.txt");
            InputStreamReader sos=new InputStreamReader(sis,StandardCharsets.UTF_8);
            BufferedReader ses=new BufferedReader(sos);
            String line;
            while((line= ses.readLine())!=null){
                System.out.println(line);
            }
            ses.close();




    }



}
